home *** CD-ROM | disk | FTP | other *** search
/ The Zoo 1: Unborn / The Zoo 1 - Unborn.adf / AUTOEXEC.AMOS / AUTOEXEC.amosSourceCode next >
Encoding:
AMOS Source Code  |  1992-10-23  |  33.9 KB  |  1,264 lines

  1. '
  2. ' SlowNote v1.0 - KLT  finished (almost) on bonfire night '95 at 2:00am
  3. '                                                 ('The Big E' is on in a
  4. '                                                  minute! Arghhhh!) 
  5. '
  6. ' Most of the code is dodgy but it does have its moments, err.. there are
  7. ' probably lotz of bits that arn't used which are in (variables,procedures)
  8. ' but I didn't have time to hunt them out and erase 'em. 
  9. ' The text printer isn't very fast but it does the job, a new one is in the
  10. ' works which should be incredibly fast (no assemebler).  The animals in the 
  11. ' backdrop are stored primaraly as SPACK files and then depacked at the
  12. ' begining of the program to a hidden screen and moved into the bank it just 
  13. ' vacated as a pure bitmap which can then be poked to the screen.
  14. ' Sorry about the lack of comments (ie. none) but if you read the 'Reasons 
  15. ' For The Delay' article you will see that I just havn't had the time. 
  16. ' If you wanna contact me for source swapping for AMOS or ASSEMBLER or just  
  17. ' general chat then my (kultS) address is in the mag, somewhere. If there is 
  18. ' a secret part, try and find it.  
  19. '
  20. ' ** Due to a lack of memory, the panal intro has been taken out and one 
  21. ' of the animals has been stopped from dpeacking, stick it back in if yer
  22. ' want but be careful, it gets VERY unstable (its in 35)... its the CAT!...? 
  23. '
  24. '------------ initialise and globalise all(most) variables 
  25. Set Buffer 50
  26. '_CHKKEY 
  27. Global SIZE_OF_HEADER,SIZE_OF_TEXT
  28. Global _MAX_AMOUNT_OF_LINES
  29. Global NUM_OF_PAGES
  30. NUM_OF_PAGES=11
  31. SIZE_OF_HEADER=24
  32. SIZE_OF_TEXT=14
  33. Y_HEADER=20
  34. SELECT_PAGE=1
  35. CURRENT_LINE=0
  36. _SELECTION_TEXT_START=Y_HEADER+SIZE_OF_HEADER+SIZE_OF_TEXT
  37. _MAX_AMOUNT_OF_LINES=(204-SIZE_OF_HEADER)/SIZE_OF_TEXT
  38. _TOTAL_SELECT_PAGES=NUM_OF_PAGES
  39. SIZE_OF_ARTICLE_FONT=8
  40. SIZE_OF_ARTICLE_HEADER=13
  41. HEADER_COLOUR=1 : ARTICLE_LEN=1
  42. PIC_AMOUNT=0
  43. FIND_FILE=False
  44. _MUSIC=True
  45. Dim PIC_NAME$(30)
  46. Dim SELECTION_TEXT_LINES$(NUM_OF_PAGES,_MAX_AMOUNT_OF_LINES)
  47. Dim HEADERS$(NUM_OF_PAGES)
  48. Dim AUTHORS$(NUM_OF_PAGES,_MAX_AMOUNT_OF_LINES)
  49. Dim _TEXT_LINES$(500)
  50. Dim FILES$(NUM_OF_PAGES,_MAX_AMOUNT_OF_LINES)
  51. Global _TOTAL_SELECT_PAGES
  52. Global SIZE_OF_ARTICLE_HEADER
  53. Global SIZE_OF_ARTICLE_FONT
  54. Global AUTHORS$(),CURRENT_LINE
  55. Global SELECTION_TEXT_LINES$()
  56. Global PIC_HEADER$
  57. Global HEADERS$(),Y_HEADER
  58. Global SELECT_PAGE,ARTICLE_HEADER$
  59. Global _TEXT_LINES$(),FILES$(),SCR
  60. Global HEADER_COLOUR,ARTICLE_LEN
  61. Global ARTICLE_SCREEN,AMOUNT_OF_PAGES
  62. Global FIND_FILE,_MUSIC
  63. Global PIC_NAME$(),PIC_AMOUNT
  64. Global CURR_PAGE,_MAXPAGES
  65. Global AN_ANIM_WAIT
  66. Global AN_ANIM
  67. Global FROM_ARTICLE
  68. FROM_ARTICLE=True
  69.  
  70. AN_ANIM_WAIT=0
  71. AN_ANIM=0
  72.  
  73. '00000 
  74. Dim TXT$(700)
  75. Global CPAGE,_MAXPAGE
  76. Global TXT$()
  77. Global HEADER$,HEADER_INK
  78. Global AUTHOR$,AUTHOR_INK
  79. Global HEADER_FONT$,HEADER_SIZE
  80. Global AUTHOR_FONT$,AUTHOR_SIZE
  81. Global MAINTEXT_FONT$,MAINTEXT_SIZE
  82. '00000 
  83.  
  84. '-------- setup file input to AMOS(RCLF) standard and root-dir 
  85. Hide On 
  86. Screen Open 0,320,256,2,Lowres
  87. Curs Off 
  88. Paper 0 : Cls 
  89. Palette 0,$FFF
  90. Flash Off 
  91. Degree 
  92. Paper 0 : Cls : Curs Off 
  93. Set Input 13,10
  94. _CHKDSK
  95. Dir$="zoo:"
  96. Assign "FONTS:" To "Zoo:Fonts"
  97. 'Amos Lock 
  98. 'Break Off 
  99. X Mouse=-200 : Y Mouse=-200
  100. Change Mouse 7
  101. Limit Mouse 128,50 To 435,287
  102. _CHKDSK
  103. 'Exec "zoo:pp" : Wait 20 
  104. Wait 20
  105.  
  106. '---------- all the procedures used by the program 
  107. Procedure _MAKEPOINTS
  108.    Unpack 10 To 0
  109.    Paper 0
  110.    Pen 1
  111. Change Mouse 1
  112.    Do 
  113.       X=X Screen(X Mouse)
  114.       Y=Y Screen(Y Mouse)
  115.       Print At(10,10);"X:";X;"  "
  116.       Print At(10,11);"Y:";Y;"  "
  117.    Loop 
  118. End Proc
  119. Procedure _CHECK_EFILES[NOP]
  120.    '
  121.    ' This checks the check code at the top of the page files to ensure
  122.    ' that they have not been changed (this ain't Magnum ya know!) 
  123.    ' Its still a simple protection nut it works.
  124.    '
  125.    
  126.    Dim TTXT$(100),ADASC(100),L(100)
  127.    _CHKDSK
  128.    For E=1 To NOP
  129.       For LKP=1 To 100
  130.          TTXT$(LKP)="" : ADASC(LKP)=0 : L(LKP)=0
  131.       Next 
  132.       FIL$="zoo:pg/epage"+Str$(E)
  133.       FIL$=FIL$-" "
  134.       
  135.       Open In 1,FIL$
  136.       LOP=0
  137.       Line Input #1,CHK$
  138.       
  139.       Repeat 
  140.          Inc LOP
  141.          Line Input #1,TTXT$(LOP)
  142.          'TTXT$(LOP)=Left$(F$,Len(F$)-1)
  143.          L(LOP)=Len(TTXT$(LOP))
  144.          For LOP2=1 To Len(TTXT$(LOP))
  145.             ADASC(LOP)=ADASC(LOP)+Asc(Mid$(TTXT$(LOP),LOP2,1))
  146.          Next 
  147.       Until Eof(1)
  148.       Close 1
  149.       
  150.       '---------- add together all the numbers *3 and change to hex
  151.       ACC=0
  152.       For LOP2=1 To LOP
  153.          ACC=ACC+ADASC(LOP2)
  154.       Next 
  155.       For LOP2=1 To LOP
  156.          ACC=ACC+L(LOP2)
  157.       Next 
  158.       ACC=ACC*3
  159.       CHK_2$=Hex$(ACC)
  160.       V1=Val(CHK$)
  161.       V2=Val(CHK_2$)
  162.       
  163.       If V1=V2
  164.          'file ok 
  165.       Else 
  166.          '---- changed file! [quits]
  167.          Palette $F00 : Edit 
  168.       End If 
  169.    Next 
  170. End Proc
  171. Procedure _SETFONT[_FNT$,SIZLE]
  172.    FINDFONT$=Lower$(_FNT$+".font")
  173.    FINDFONT$=FINDFONT$-" "
  174.    FINDFONTLEN=Len(FINDFONT$)
  175.    FINDFONTLENSP=30-FINDFONTLEN
  176.    FINDFONT$=FINDFONT$+Space$(FINDFONTLENSP)
  177.    
  178.    LOPFONT=0
  179.    
  180.    Repeat 
  181.       Inc LOPFONT
  182.       CUR_FONT$=Lower$(Font$(LOPFONT))
  183.       NAME_FONT$=Left$(CUR_FONT$,30)
  184.       SIZE_FONT=Val(Mid$(CUR_FONT$,31,2))
  185.       '      If LOPFONT>11 
  186.       '         Palette Rnd($FFF) : Bell 
  187.       '      End If  
  188.    Until SIZE_FONT=SIZLE and NAME_FONT$=FINDFONT$
  189.    
  190.    Set Font LOPFONT
  191. End Proc
  192. Procedure _CHKKEY
  193.    Screen Open 0,320,256,2,Lowres
  194.    Curs Off 
  195.    'Hide  
  196.    Paper 0 : Cls 
  197.    Palette 0,$FFF
  198.    Flash Off 
  199.    Degree 
  200.    Do 
  201.       S$=Inkey$
  202.       S=Scancode
  203.       Print S
  204.    Loop 
  205. End Proc
  206. Procedure _UPDATE_TITLEBAR_FOR_SELECT
  207.    Screen 2 : Paper 0 : Cls 
  208.    Curs Off 
  209.    Home : Print "Zoo Issue 1 - INDEX"
  210.    Print At(65,0);"Page";SCR;" of";_TOTAL_SELECT_PAGES;"  "
  211.    Screen 0
  212. End Proc
  213. Procedure _UPDATE_TITLEBAR_FOR_DOC
  214.    Screen 2
  215.    Paper 0 : Cls : Home 
  216.    Curs Off 
  217.    Home : Print HEADER$;"                     "
  218.    Print At(65,0);"Page";CPAGE;" of";_MAXPAGE;"  "
  219.    Screen 0
  220. End Proc
  221. Procedure _UPDATE_TITLEBAR_FOR_PICS
  222.    Screen 2
  223.    Curs Off 
  224.    Home : Print PIC_HEADER$;"                    "
  225.    Print At(65,0);"Page";CURR_PAGE;" of";_MAXPAGES;"  "
  226.    Screen 0
  227. End Proc
  228. Procedure _SETUP_ICON_DETECT_ZONES
  229.    Screen 1
  230.    Reserve Zone 7
  231.    '------- INDEX   
  232.    Set Zone 1,218,6 To 262,33
  233.    
  234.    '------- EAT ME
  235.    Set Zone 2,165,5 To 209,34
  236.    
  237.    '------- MUSIC 
  238.    Set Zone 3,7,6 To 50,34
  239.    
  240.    '------- FIRST   
  241.    Set Zone 4,60,6 To 103,33
  242.    
  243.    '------- LAST  
  244.    Set Zone 5,112,6 To 156,33
  245.    
  246.    '------- <<<<  
  247.    Set Zone 7,267,19 To 299,35
  248.    
  249.    '------- >>>>  
  250.    Set Zone 6,283,5 To 317,20
  251. End Proc
  252. Procedure _SETUP_BOBS
  253.    Screen Open 0,640,256,8,Hires
  254.    Curs Off 
  255.    Paper 0 : Cls 
  256.    Palette 0,$FFF
  257.    Flash Off 
  258.    Degree 
  259.    Ink 1
  260.    Bar 0,0 To 640,SIZE_OF_TEXT
  261.    Get Bob 1,0,0 To 640,SIZE_OF_TEXT
  262.    Screen Close 0
  263.    Load Iff "zoo:m1",0 : Get Bob 3,1,1 To 16,16
  264.    Load Iff "zoo:m2",0 : Get Bob 4,1,1 To 16,29
  265. End Proc
  266. Procedure _FONTS_INTO_RAM[AMOUNT_OF_FONTS]
  267.    _CHKDSK
  268.    Get Fonts 
  269.    'For LOP=1 To AMOUNT_OF_FONTS
  270.    '   Set Font LOP 
  271.    'Next  
  272.    'Get Fonts 
  273. End Proc
  274. Procedure _INFO_ON_FONTS[AMOUNT_OF_FONTS]
  275.    Screen Open 0,640,256,2,Hires
  276.    Curs Off 
  277.    Hide 
  278.    Paper 0 : Cls 
  279.    Palette 0,$FFF
  280.    Flash Off 
  281.    Degree 
  282.    
  283.    For LOP=1 To AMOUNT_OF_FONTS
  284.       Print LOP;"  ";Font$(LOP)
  285.       Wait Key 
  286.    Next 
  287. End Proc
  288. Procedure _SETUP_SCREENS
  289.    '------- TITLE BAR 
  290.    Screen Open 2,640,50,2,Hires
  291.    Curs Off 
  292.    Flash Off 
  293.    Palette $0,$0
  294.    Screen Display 2,,40,,8 : Hide On : Wait Vbl 
  295.    Centre "...Loading ZOO Issue 1 Index..."
  296.    Fade 1,$FFF,$FFF
  297.    Wait 15
  298.    Fade 1,$415,$FFF
  299.    Wait 15
  300.    Wait Vbl 
  301.    
  302.    '------- CONTROL BAR   
  303.    Unpack 10 To 1
  304.    Palette 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  305.    Fade 5,$0,$FF9,$27,$6,$38,$49,$58,$16B,$28B,$203,$F70,$7AC,$9CE,$500,$BEF,$FFF
  306.    For YP=256+55 To 256 Step -1
  307.       Screen Display 1,,YP,,
  308.       Wait Vbl 
  309.    Next 
  310.    Fade 2,0,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF
  311.    Wait 2*15
  312.    Fade 3,$0,$FF9,$27,$6,$38,$49,$58,$16B,$28B,$203,$F70,$7AC,$9CE,$500,$BEF,$FFF
  313.    Screen To Front 1
  314.  
  315.    _SETUP_ICON_DETECT_ZONES
  316.    
  317.    '------- MAIN SCREEN (temp)
  318.    Screen Open 0,320,56,2,Lowres
  319.    Curs Off 
  320.    Paper 0 : Cls 
  321.    Palette 0,$0
  322.    Flash Off 
  323. End Proc
  324. Procedure _LOAD_SELECTION_PAGES
  325.    Screen 0
  326.    
  327.    '------ load the authors,names and filenames into dimensions from a file     
  328.    _CHKDSK
  329.    For LOP1=1 To NUM_OF_PAGES
  330.       _LOAD$="pg/epage"+Str$(LOP1)
  331.       _LOAD$=_LOAD$-" "
  332.       Open In 1,_LOAD$
  333.       Line Input #1,ZZ$
  334.       Line Input #1,HEADERS$(LOP1)
  335.       
  336.       LOP2=0
  337.       Screen 0
  338.       Repeat 
  339.          'Screen 0
  340.          Inc LOP2
  341.          Line Input #1,SELECTION_TEXT_LINES$(LOP1,LOP2)
  342.          'SELECTION_TEXT_LINES$(LOP1,LOP2)=Left$(SELECTION_TEXT_LINES$(LOP1,LOP2),Len(SELECTION_TEXT_LINES$(LOP1,LOP2))-1)
  343.          Line Input #1,AUTHORS$(LOP1,LOP2)
  344.          'AUTHORS$(LOP1,LOP2)=Left$(AUTHORS$(LOP1,LOP2),Len(AUTHORS$(LOP1,LOP2))-1) 
  345.          Line Input #1,FILES$(LOP1,LOP2)
  346.          'FILES$(LOP1,LOP2)=Left$(FILES$(LOP1,LOP2),Len(FILES$(LOP1,LOP2))-1) 
  347.       Until Eof(1)
  348.       Close 1
  349.    Next 
  350. End Proc
  351. Procedure _SHOW_SELECTION_SCREEN[SCR]
  352.    '----- just in case... 
  353.    If SCR>NUM_OF_PAGES Then Pop Proc
  354.    _UPDATE_TITLEBAR_FOR_SELECT
  355.    
  356.    '-------- setup screen for the text
  357.    Screen 0 : Flash Off : Fade 1,0,0,0,0,0,0,0,0 : Wait 15
  358.    'Screen 0 : Autoback 0 : Paper 0 : Cls : Screen Swap : Paper 0 : Cls 
  359.    'Unpack 12 To 0
  360.    
  361.    '   If FROM_ARTICLE=True 
  362.    Screen Open 0,640,255,8,Hires
  363.    Paper 0 : Cls : Curs Off 
  364.    Palette 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  365.    Flash Off 
  366.    Screen To Back 0
  367.    Screen Display 0,,50,,
  368.    Double Buffer : Autoback 0
  369.    
  370.    '------ set header font and calculate its central position(autoconfig2res) 
  371.    
  372.    '   Copy Start(30),Start(30)+Length(30) To PHBASE
  373.    
  374.    _SETFONT["newcentury",24]
  375.    _CENTRE=Screen Width(0)/2
  376.    HEADER_WIDTH=Text Length(HEADERS$(SCR))
  377.    XPOS_PLACE_HEADER=_CENTRE-(HEADER_WIDTH/2)
  378.    Paper 0
  379.    Ink 5 : Gr Writing 2
  380.    Text XPOS_PLACE_HEADER,Y_HEADER,HEADERS$(SCR)
  381.    
  382.    '------- place all the text AFTER the header (self configuring)    
  383.    _SETFONT["citylight",14]
  384.    For LOP=1 To _MAX_AMOUNT_OF_LINES
  385.       Text 5,SIZE_OF_HEADER+(LOP*SIZE_OF_TEXT),SELECTION_TEXT_LINES$(SCR,LOP)
  386.    Next 
  387.    For LOP=1 To _MAX_AMOUNT_OF_LINES
  388.       Text 635-Text Length(AUTHORS$(SCR,LOP)),SIZE_OF_HEADER+(LOP*SIZE_OF_TEXT),AUTHORS$(SCR,LOP)
  389.    Next 
  390.    
  391.    PHBASE=Logbase(0)
  392.    If AN_ANIM<1 or AN_ANIM>6
  393.       AN_ANIM=1
  394.    End If 
  395.    AN_ANIM_WAIT=1
  396.    Copy Start(AN_ANIM+29),Start(AN_ANIM+29)+Length(AN_ANIM+29) To PHBASE
  397.    
  398.    Screen Copy Logic To Physic
  399.    Fade 1,$0,$113,$555,$555,$411,$224,$66F,$AAA
  400.    Wait 15
  401. End Proc
  402. Procedure _LOAD_TEXT[NUMIN]
  403.    '
  404.    ' this procedure loads in the ascii file, line by line into an array.  
  405.    ' whilst its doing this it also looks for any use of colour or headers 
  406.    ' etc and makes notes on the left most part of the line in the form of a 
  407.    ' '{' character. 
  408.    '
  409.    
  410.    _LOAD$="Zoo:Articles/"+FILES$(SCR,NUMIN-1)
  411.    _LOAD$=_LOAD$-" "
  412.    
  413.    '---- is it there? 
  414.    If Not Exist(_LOAD$)
  415.       FIND_FILE=False
  416.       Pop Proc
  417.    Else 
  418.       FIND_FILE=True
  419.    End If 
  420.    _CHKDSK
  421.    Change Mouse 7
  422.    '---- clear article buffer ready for the new article 
  423.    For LOP=0 To 700
  424.       TXT$(LOP)=""
  425.    Next 
  426.    
  427.    '---- test if it is an IFFLOAD (file input reset to 10,-1) - LF
  428.    Set Input 10,-1
  429.    Open In 1,_LOAD$
  430.    Line Input #1,TST$
  431.    If Mid$(TST$,0,3)<>"PIC"
  432.       '--- not a picture so the file input is set back to 13,10 - RCLF 
  433.       Close 1
  434.       Set Input 13,10
  435.       Open In 1,_LOAD$
  436.       
  437.       SIZESDONE=False
  438.       LOP=0
  439.       ARTICLE_LEN=0
  440.       Repeat 
  441.          Line Input #1,F$
  442.          
  443.          NO_NEED=False
  444.          
  445.          '---- check for the header name
  446.          If Mid$(F$,0,2)="@H"
  447.             HEADER$=Mid$(F$,5,Len(F$)-4)
  448.             HEADER_INK=Val(Mid$(F$,4,1))
  449.             NO_NEED=True
  450.          End If 
  451.          
  452.          '---- check for the author(s) name 
  453.          If Mid$(F$,0,2)="@A"
  454.             AUTHOR$=Mid$(F$,5,Len(F$)-4)
  455.             AUTHOR_INK=Val(Mid$(F$,4,1))
  456.             NO_NEED=True
  457.          End If 
  458.          
  459.          '---- check for AUTHOR font allocation string
  460.          If Mid$(F$,0,3)="@FA"
  461.             AUTHOR_FONT$=Right$(F$,Len(F$)-3)
  462.             AUTHOR_FONT$=Left$(AUTHOR_FONT$,Len(AUTHOR_FONT$)-2)
  463.             AUTHOR_SIZE=Val(Right$(F$,2))
  464.             NO_NEED=True
  465.          End If 
  466.          
  467.          '---- check for HEADER font allocation string
  468.          If Mid$(F$,0,3)="@FH"
  469.             HEADER_FONT$=Right$(F$,Len(F$)-3)
  470.             HEADER_FONT$=Left$(HEADER_FONT$,Len(HEADER_FONT$)-2)
  471.             HEADER_SIZE=Val(Right$(F$,2))
  472.             NO_NEED=True
  473.          End If 
  474.          
  475.          '---- check for MAINTEXT font allocation string
  476.          If Mid$(F$,0,3)="@FM"
  477.             MAINTEXT_FONT$=Right$(F$,Len(F$)-3)
  478.             MAINTEXT_FONT$=Left$(MAINTEXT_FONT$,Len(MAINTEXT_FONT$)-2)
  479.             MAINTEXT_SIZE=Val(Right$(F$,2))
  480.             NO_NEED=True
  481.          End If 
  482.          
  483.          '----- check for BACKCOLOUR hex colour string
  484.          If Mid$(F$,0,2)="@$"
  485.             BACKCOLOUR$=Mid$(F$,1,4)
  486.             NO_NEED=True
  487.          End If 
  488.          
  489.          If F$="X0*]"
  490.             NO_NEED=True
  491.          End If 
  492.          
  493.          
  494.          If NO_NEED=False
  495.             Inc LOP
  496.             TXT$(LOP)=F$
  497.             Inc ARTICLE_LEN
  498.          End If 
  499.          
  500.       Until F$="X0*]"
  501.       Close 1
  502.       Change Mouse 6
  503.       Pop Proc
  504.    End If 
  505.    
  506.    
  507.    '------------ THIS BIT LOADS PICTURES! 
  508.    '----- hoho    
  509.    Change Mouse 7
  510.    Line Input #1,F$
  511.    PIC_AMOUNT=Val(F$)
  512.    Line Input #1,F$
  513.    PIC_HEADER$=F$
  514.    For LOP=1 To PIC_AMOUNT
  515.       Line Input #1,PIC_NAME$(LOP)
  516.    Next 
  517.    Close 1
  518.    
  519.    _MAXPAGES=PIC_AMOUNT
  520.    CURR_PAGE=1
  521.    _UPDATE_PIC=True
  522.    
  523.    Repeat 
  524.       If _UPDATE_PIC=True
  525.          Screen 0
  526.          Change Mouse 7
  527.          Load Iff "zoo:pics/"+PIC_NAME$(CURR_PAGE),0
  528.          Screen To Back 0
  529.          Screen Display 0,,52,,
  530.          _UPDATE_PIC=False
  531.          _UPDATE_TITLEBAR_FOR_PICS
  532.          Change Mouse 6
  533.          S$=""
  534.          S=0
  535.          Clear Key 
  536.       End If 
  537.       
  538.       S=Scancode
  539.       S$=Inkey$
  540.       
  541.       If Mouse Screen=1 or S>0
  542.          Screen 1
  543.          If Mouse Key=1 or S>0
  544.             Z=Mouse Zone
  545.             
  546.             If(Z=3 and Mouse Key=1) or S=55
  547.                _MUSIC_OPTION
  548.                Z=0
  549.                S=0
  550.                Clear Key 
  551.             End If 
  552.             
  553.             If(Z=4 and Mouse Key=1) or S=80
  554.                If CURR_PAGE>1
  555.                   CURR_PAGE=1 : _UPDATE_PIC=True
  556.                   Z=0
  557.                   S=0
  558.                   Clear Key 
  559.                End If 
  560.             End If 
  561.             
  562.             If(Z=5 and Mouse Key=1) or S=81
  563.                If CURR_PAGE<_MAXPAGES
  564.                   CURR_PAGE=_MAXPAGES : _UPDATE_PIC=True
  565.                   Z=0
  566.                   S=0
  567.                   Clear Key 
  568.                End If 
  569.             End If 
  570.             
  571.             If(Z=6 and Mouse Key=1) or S=78
  572.                If CURR_PAGE<_MAXPAGES
  573.                   Inc CURR_PAGE : _UPDATE_PIC=True
  574.                   Z=0
  575.                   S=0
  576.                   Clear Key 
  577.                End If 
  578.             End If 
  579.             
  580.             If(Z=7 and Mouse Key=1) or S=79
  581.                If CURR_PAGE>1
  582.                   Dec CURR_PAGE : _UPDATE_PIC=True
  583.                End If 
  584.                Z=0
  585.                S=0
  586.                Clear Key 
  587.             End If 
  588.             
  589.             '----- eat me
  590.             If(Z=2 and Mouse Key=1) or S=82
  591.                Screen 2 : Paper 0 : Cls 
  592.                Screen To Front 2
  593.                Screen Display 2,,,,16
  594.                Home : Print "Please enter the page you wish to go to: (1 -"+Str$(_MAXPAGES)+")"
  595.                Input GTO$
  596.                GTO=Val(GTO$)
  597.                Screen Display 2,,,,8
  598.                Screen To Back 2
  599.                Screen 2 : Paper 0 : Cls 
  600.                
  601.                If GTO>0 and GTO=<_MAXPAGES and GTO<>CURR_PAGE
  602.                   Screen 0
  603.                   CURR_PAGE=GTO
  604.                   _UPDATE_PIC=True
  605.                   Screen 1
  606.                Else 
  607.                   _UPDATE_TITLEBAR_FOR_PICS
  608.                End If 
  609.                Screen 1
  610.                Z=0
  611.                S=0
  612.                Clear Key 
  613.             End If 
  614.          End If 
  615.       End If 
  616.    Until Mouse Key=1 and Mouse Zone=1 or S=69
  617.    Screen 0 : Fade 1 : Wait 15 : Paper 0 : Cls 
  618.    _SHOW_SELECTION_SCREEN[SCR]
  619.    FIND_FILE=False
  620.    
  621. End Proc
  622. Procedure _SHOW_TEXT_FILE2[HEADERFONT$,HEADERSIZE,AUTHORFONT$,AUTHORSIZE,MAINTEXTFONT$,MAINTEXTSIZE,PAGE]
  623.    _UPDATE_TITLEBAR_FOR_DOC
  624.    Paper 0 : Cls 
  625.    Gr Writing 0
  626.    _CLEAR_PALETTE
  627.    
  628.    If PAGE=1
  629.       '------ for the first page...
  630.       '------ put on a header
  631.       _SETFONT[HEADERFONT$,HEADERSIZE]
  632.       TL=Text Length(HEADER$)
  633.       TL=TL/2
  634.       Ink HEADER_INK
  635.       Text 320-TL,HEADERSIZE,HEADER$
  636.       
  637.       '------ and the author       
  638.       _SETFONT[AUTHORFONT$,AUTHORSIZE]
  639.       TL=Text Length(AUTHOR$)
  640.       TL=TL/2
  641.       Ink AUTHOR_INK
  642.       Text 320-TL,AUTHORSIZE+HEADERSIZE,AUTHOR$
  643.       
  644.       '------ and some main text 
  645.       CURRLINE=0
  646.       YPOS=HEADERSIZE+AUTHORSIZE
  647.       _SETFONT[MAINTEXTFONT$,MAINTEXTSIZE]
  648.       
  649.       Repeat 
  650.          Inc CURRLINE
  651.          YPOS=YPOS+MAINTEXTSIZE
  652.          
  653.          '------ are there any colour changes on this line??
  654.          If Left$(TXT$(CURRLINE),1)="{"
  655.             XPOS=0
  656.             For LOP=3 To Len(TXT$(CURRLINE))
  657.                If Mid$(TXT$(CURRLINE),LOP,1)="@"
  658.                   Ink Val(Mid$(TXT$(CURRLINE),LOP+1,1))
  659.                   LOP=LOP+2
  660.                End If 
  661.                G$=Mid$(TXT$(CURRLINE),LOP,1)
  662.                
  663.                TEXLEN=Text Length(G$)
  664.                XPOS=XPOS+TEXLEN
  665.                Text XPOS-TEXLEN,YPOS,G$
  666.             Next 
  667.             
  668.          Else 
  669.             '------ if no changes, just print the text as a whole line 
  670.             Ink Val(Left$(TXT$(CURRLINE),1))
  671.             If Len(TXT$(CURRLINE))>0
  672.                Text 0,YPOS,Right$(TXT$(CURRLINE),Len(TXT$(CURRLINE))-1)
  673.             End If 
  674.          End If 
  675.       Until YPOS>(204-MAINTEXTSIZE)
  676.       
  677.    Else 
  678.       '----- NOT page 1 so forget all the headers etc and just do text 
  679.       
  680.       SIZE1=HEADERSIZE+AUTHORSIZE-MAINTEXTSIZE
  681.       MOST_ON_1ST_PAGE=Int((204-SIZE1)/MAINTEXTSIZE)
  682.       MOST_ON_NORMAL_PAGE=Int(204/MAINTEXTSIZE)
  683.       CURRLINE=MOST_ON_1ST_PAGE+(MOST_ON_NORMAL_PAGE*(PAGE-2))
  684.       
  685.       YPOS=0
  686.       Repeat 
  687.          YPOS=YPOS+MAINTEXTSIZE
  688.          
  689.          '----- are there any middle changes??  
  690.          If Left$(TXT$(CURRLINE),1)="{"
  691.             XPOS=0
  692.             For LOP=3 To Len(TXT$(CURRLINE))
  693.                
  694.                CURRENT_INK=Val(Mid$(TXT$(CURRLINE),2,1))
  695.                If Mid$(TXT$(CURRLINE),LOP,1)="@"
  696.                   CURRENT_INK=Val(Mid$(TXT$(CURRLINE),LOP+1,1))
  697.                   Ink CURRENT_INK
  698.                   LOP=LOP+2
  699.                End If 
  700.                G$=Mid$(TXT$(CURRLINE),LOP,1)
  701.                
  702.                TEXLEN=Text Length(G$)
  703.                XPOS=XPOS+TEXLEN
  704.                Text XPOS-TEXLEN,YPOS,G$
  705.             Next 
  706.          Else 
  707.             
  708.             '------ no, so just paste the entire line
  709.             Ink Val(Left$(TXT$(CURRLINE),1))
  710.             If Len(TXT$(CURRLINE))>0
  711.                Text 0,YPOS,Right$(TXT$(CURRLINE),Len(TXT$(CURRLINE))-1)
  712.             End If 
  713.          End If 
  714.          Inc CURRLINE
  715.          
  716.       Until YPOS>(204-MAINTEXTSIZE)
  717.    End If 
  718.    _RESTORE_PALETTE
  719.    Wait 15
  720. End Proc
  721. Procedure _HANDLE_TEXT_FILE
  722.    Screen Open 0,640,235,8,Hires
  723.    Screen To Back 0
  724.    Curs Off 
  725.    Paper 0 : Cls 
  726.    Flash Off 
  727.    Palette 0,$AF1,$F00,$FF0,$FA1,$559,$F84
  728.    Flash 7,"(FFF,20)(000,20)"
  729.    Screen Display 0,,50,,
  730.    
  731.    SIZE_1=HEADER_SIZE+AUTHOR_SIZE
  732.    G=204-SIZE_1
  733.    H=G/MAINTEXT_SIZE
  734.    J=204/MAINTEXT_SIZE
  735.    '_maxpages has 2 added because the INT spare is added on and the title page
  736.    'is add. 
  737.    If ARTICLE_LEN>H
  738.       PAGES1=ARTICLE_LEN-H : PAGES2=PAGES1/J : _MAXPAGE=Int(PAGES2)+2
  739.    Else 
  740.       _MAXPAGE=1
  741.    End If 
  742.    
  743.    CPAGE=1
  744.    _SHOW_TEXT_FILE2[HEADER_FONT$,HEADER_SIZE,AUTHOR_FONT$,AUTHOR_SIZE,MAINTEXT_FONT$,MAINTEXT_SIZE,CPAGE]
  745.    Screen 1
  746.    Repeat 
  747.       S=Scancode
  748.       S$=Inkey$
  749.       
  750.       If Mouse Key=1 or S>0
  751.          Z=Mouse Zone
  752.          
  753.          '------ >>>> 
  754.          If(Z=6 and Mouse Key=1) or S=78
  755.             If CPAGE<_MAXPAGE
  756.                Inc CPAGE
  757.                Screen 0
  758.                _SHOW_TEXT_FILE2[HEADER_FONT$,HEADER_SIZE,AUTHOR_FONT$,AUTHOR_SIZE,MAINTEXT_FONT$,MAINTEXT_SIZE,CPAGE]
  759.                Screen 1
  760.                Z=0
  761.                S=0
  762.                Clear Key 
  763.             End If 
  764.          End If 
  765.          
  766.          '------ <<<< 
  767.          If(Z=7 and Mouse Key=1) or S=79
  768.             If CPAGE>1
  769.                Dec CPAGE
  770.                Screen 0
  771.                _SHOW_TEXT_FILE2[HEADER_FONT$,HEADER_SIZE,AUTHOR_FONT$,AUTHOR_SIZE,MAINTEXT_FONT$,MAINTEXT_SIZE,CPAGE]
  772.                Screen 1
  773.                Z=0
  774.                S=0
  775.                Clear Key 
  776.             End If 
  777.          End If 
  778.          
  779.          '------ MUSIC
  780.          If(Z=3 and Mouse Key=1) or S=55
  781.             _MUSIC_OPTION
  782.             Z=0
  783.             S=0
  784.             Clear Key 
  785.          End If 
  786.          
  787.          '------ first page 
  788.          If(Z=4 and Mouse Key=1) or S=80
  789.             If CPAGE>1
  790.                Screen 0
  791.                CPAGE=1
  792.                _SHOW_TEXT_FILE2[HEADER_FONT$,HEADER_SIZE,AUTHOR_FONT$,AUTHOR_SIZE,MAINTEXT_FONT$,MAINTEXT_SIZE,CPAGE]
  793.                Screen 1
  794.                Z=0
  795.                S=0
  796.                Clear Key 
  797.             End If 
  798.          End If 
  799.          
  800.          '------ last page  
  801.          If(Z=5 and Mouse Key=1) or S=81
  802.             If CPAGE<_MAXPAGE
  803.                Screen 0
  804.                CPAGE=_MAXPAGE
  805.                _SHOW_TEXT_FILE2[HEADER_FONT$,HEADER_SIZE,AUTHOR_FONT$,AUTHOR_SIZE,MAINTEXT_FONT$,MAINTEXT_SIZE,CPAGE]
  806.                Screen 1
  807.                Z=0
  808.                S=0
  809.                Clear Key 
  810.             End If 
  811.          End If 
  812.          
  813.          '----- eat me
  814.          If(Z=2 and Mouse Key=1) or S=82
  815.             Screen 2 : Paper 0 : Cls 
  816.             Screen To Front 2
  817.             Screen Display 2,,,,16
  818.             Home : Print "Please enter the page you wish to go to: (1 -"+Str$(_MAXPAGE)+")"
  819.             Input GTO$
  820.             GTO=Val(GTO$)
  821.             Screen Display 2,,,,8
  822.             Screen To Back 2
  823.             Screen 2 : Paper 0 : Cls 
  824.             
  825.             If GTO>0 and GTO=<_MAXPAGE and GTO<>CPAGE
  826.                Screen 0
  827.                CPAGE=GTO
  828.                _SHOW_TEXT_FILE2[HEADER_FONT$,HEADER_SIZE,AUTHOR_FONT$,AUTHOR_SIZE,MAINTEXT_FONT$,MAINTEXT_SIZE,CPAGE]
  829.                Screen 1
  830.             Else 
  831.                _UPDATE_TITLEBAR_FOR_DOC
  832.             End If 
  833.             Screen 1
  834.             Z=0
  835.             S=0
  836.             Clear Key 
  837.          End If 
  838.          
  839.       End If 
  840.    Until(Mouse Key=1 and Mouse Zone=1) or S=69
  841.    _SHOW_SELECTION_SCREEN[SCR]
  842. End Proc
  843. Procedure _SELECT_ONE[SCR]
  844.    Autoback 2
  845.    Show On 
  846.    Change Mouse 6
  847.    
  848.    Do 
  849.       Set Bob 1,,-3,%111000
  850.       Y=(Y Screen(Y Mouse)/SIZE_OF_TEXT)*SIZE_OF_TEXT
  851.       
  852.       PHBASE=Phybase(0)
  853.       Add AN_ANIM_WAIT,1,1 To 50
  854.       If AN_ANIM_WAIT=50
  855.          AN_ANIM=AN_ANIM+1
  856.          If AN_ANIM>5
  857.             AN_ANIM=1
  858.          End If 
  859.       End If 
  860.       
  861.       '      If AN_ANIM<1
  862.       '         AN_ANIM=1
  863.       '      End If  
  864.       '      If AN_ANIM>6
  865.       '         AN_ANIM=7
  866.       '      End If  
  867.       
  868.       
  869.       Copy Start(AN_ANIM+29),Start(AN_ANIM+29)+Length(AN_ANIM+29) To PHBASE
  870.       
  871.       '------ make sure line stays between limits
  872.       If Y>SIZE_OF_HEADER
  873.          If Y<SIZE_OF_HEADER+(SIZE_OF_TEXT*_MAX_AMOUNT_OF_LINES)
  874.             If SELECTION_TEXT_LINES$(SCR,((Y-2)/(SIZE_OF_TEXT-1))-1)<>""
  875.                Bob 1,0,Y-2,1
  876.                CURRENT_LINE=(Y-2)/(SIZE_OF_TEXT-1)
  877.                
  878.                '*** Update titlebar with the current file 
  879.                Screen 2 : Home 
  880.                _ADD=(40-Len(SELECTION_TEXT_LINES$(SCR,CURRENT_LINE-1)))/2
  881.                TIT_BAR_TEXT$=Space$(_ADD)+SELECTION_TEXT_LINES$(SCR,CURRENT_LINE-1)+Space$(_ADD)
  882.                Centre TIT_BAR_TEXT$
  883.                Screen 0
  884.                
  885.                If Mouse Key=1
  886.                   Wait Vbl 
  887.                   Screen Swap 
  888.                   _LOAD_TEXT[CURRENT_LINE]
  889.                   If FIND_FILE=True
  890.                      Fade 1,0,0,0,0,0,0,0,0,0 : Wait 15
  891.                      _HANDLE_TEXT_FILE
  892.                   End If 
  893.                End If 
  894.             Else 
  895.                Bob Off 1
  896.                Screen 2 : Centre Space$(40) : Screen 0
  897.             End If 
  898.          Else 
  899.             Bob Off 1
  900.             Screen 2 : Centre Space$(40) : Screen 0
  901.          End If 
  902.       Else 
  903.          Bob Off 1
  904.          Screen 2 : Centre Space$(40) : Screen 0
  905.       End If 
  906.       
  907.       '----- get key input       
  908.       S$=Inkey$
  909.       S=Scancode
  910.       
  911.       '------ if the pointer goes below max then begin to check icons      
  912.       If Y>SIZE_OF_HEADER+(SIZE_OF_TEXT*_MAX_AMOUNT_OF_LINES) or S<>0
  913.          Screen 1
  914.          If Mouse Key=1 or S<>0
  915.             Z=Mouse Zone
  916.             
  917.             If(Z=3 and Mouse Key=1) or S=55
  918.                _MUSIC_OPTION
  919.                Z=0
  920.             End If 
  921.             
  922.             If(Z=4 and Mouse Key=1) or S=80
  923.                If SCR>1
  924.                   SCR=1 : FROM_ARTICLE=False : _SHOW_SELECTION_SCREEN[SCR]
  925.                   Z=0
  926.                End If 
  927.             End If 
  928.             
  929.             If(Z=5 and Mouse Key=1) or S=81
  930.                If SCR<NUM_OF_PAGES
  931.                   SCR=NUM_OF_PAGES : FROM_ARTICLE=False : _SHOW_SELECTION_SCREEN[SCR]
  932.                   Z=0
  933.                End If 
  934.             End If 
  935.             
  936.             If(Z=6 and Mouse Key=1) or S=78
  937.                If SCR<NUM_OF_PAGES
  938.                   Inc SCR : FROM_ARTICLE=False : _SHOW_SELECTION_SCREEN[SCR]
  939.                   Z=0
  940.                End If 
  941.             End If 
  942.             
  943.             If(Z=7 and Mouse Key=1) or S=79
  944.                If SCR>1
  945.                   Dec SCR : FROM_ARTICLE=False : _SHOW_SELECTION_SCREEN[SCR]
  946.                   Z=0
  947.                End If 
  948.             End If 
  949.             
  950.             '----- eat me
  951.             If(Z=2 and Mouse Key=1) or S=82
  952.                Screen 2 : Paper 0 : Cls 
  953.                Screen To Front 2
  954.                Screen Display 2,,,,16
  955.                Home : Print "Please enter the page you wish to go to: (1 -"+Str$(NUM_OF_PAGES)+")"
  956.                Input GTO$
  957.                GTO=Val(GTO$)
  958.                Screen Display 2,,,,8
  959.                Screen To Back 2
  960.                Screen 2 : Paper 0 : Cls 
  961.                
  962.                If GTO>0 and GTO=<NUM_OF_PAGES and GTO<>SCR
  963.                   Screen 0
  964.                   SCR=GTO
  965.                   FROM_ARTICLE=False
  966.                   _SHOW_SELECTION_SCREEN[SCR]
  967.                   Screen 1
  968.                Else 
  969.                   _UPDATE_TITLEBAR_FOR_SELECT
  970.                End If 
  971.                Screen 1
  972.                Z=0
  973.             End If 
  974.             
  975.             If S<>0
  976.                S=0
  977.                S$=""
  978.                Clear Key 
  979.             End If 
  980.             
  981.          End If 
  982.       End If 
  983.       Screen 0
  984.       Wait Vbl 
  985.    Loop 
  986. End Proc
  987. Procedure _LOAD_FILE_NAMES
  988.    For LOP1=1 To NUM_OF_PAGES
  989.       _LOAD$="file/page"+Str$(LOP1)+".files"
  990.       _LOAD$=_LOAD$-" "
  991.       Open In 1,_LOAD$
  992.       For LOP2=1 To _MAX_AMOUNT_OF_LINES
  993.          Line Input #1,F$
  994.          FILES$(LOP1,LOP2)=F$
  995.          Print F$
  996.       Next 
  997.       Close 1
  998.    Next 
  999. End Proc
  1000. Procedure _SHOW_TEXT_FILE
  1001.    BACK_TO_SELECT=False
  1002.    HEADER_START=12
  1003.    _UPDATE_TEXT=True
  1004.    Screen Open 0,640,205,8,Hires
  1005.    Curs Off 
  1006.    Paper 0 : Cls 
  1007.    Flash Off 
  1008.    Palette 0,0,0,0,0,0,0,0,0,0,0,0,0
  1009.    Screen To Back 0
  1010.    Screen Display 0,,50,,
  1011.    
  1012.    Gr Writing 0
  1013.    Wait Vbl 
  1014.    
  1015.    _SETFONT["beton",13]
  1016.    _CENTRE=Screen Width(0)/2
  1017.    HEADER_WIDTH=Text Length(ARTICLE_HEADER$)
  1018.    XPOS_PLACE_HEADER=_CENTRE-(HEADER_WIDTH/2)
  1019.    LINES_PER_PAGE_NOT_INC_HEADER=Screen Height(0)/SIZE_OF_ARTICLE_FONT
  1020.    LINES_PER_PAGE_INC_HEADER=(LINES_PER_PAGE_NOT_INC_HEADER-SIZE_OF_HEADER_FONT)
  1021.    '--- i'm a bit worried on the max pages calculation, needs lotz testin --- 
  1022.    AMOUNT_OF_PAGES=Int(ARTICLE_LEN/LINES_PER_PAGE_NOT_INC_HEADER)+1
  1023.    ARTICLE_SCREEN=1
  1024.    
  1025.    
  1026.    _SETFONT["darkparticle",8]
  1027.    _UPDATE_TITLEBAR_FOR_DOC
  1028.    Change Mouse 6
  1029.    Repeat 
  1030.       If _UPDATE_TEXT=True
  1031.          Screen 0
  1032.          Flash Off 
  1033.          Fade 1,0,0,0,0,0,0,0,0,0 : Wait 15
  1034.           Extension_12_0380 -1
  1035.  
  1036.          Wait Vbl 
  1037.          Clear Key 
  1038.          S=0
  1039.          S$=""
  1040.          
  1041.          If ARTICLE_SCREEN=1
  1042.             LINES_PER_PAGE=LINES_PER_PAGE_INC_HEADER
  1043.             _SETFONT["beton",13]
  1044.             Ink HEADER_COLOUR
  1045.             Text XPOS_PLACE_HEADER,HEADER_START,ARTICLE_HEADER$
  1046.             'YPOS=SIZE_OF_ARTICLE_HEADER 
  1047.             YPOS=HEADER_START+5
  1048.             _SETFONT["darkparticle",8]
  1049.             LOP=((ARTICLE_SCREEN-1)*(Screen Height(0)/SIZE_OF_ARTICLE_FONT))+1
  1050.          Else 
  1051.             LINES_PER_PAGE=LINES_PER_PAGE_NOT_INC_HEADER
  1052.             LOP=(ARTICLE_SCREEN-1)*(Screen Height(0)/SIZE_OF_ARTICLE_FONT)
  1053.             YPOS=7
  1054.          End If 
  1055.          _UPDATE_TITLEBAR_FOR_DOC
  1056.          Repeat 
  1057.             Inc LOP
  1058.             TEXIN$=_TEXT_LINES$(LOP)
  1059.             If Mid$(TEXIN$,0,1)="@"
  1060.                Ink Val(Mid$(TEXIN$,2,1))
  1061.                TEXIN$=Mid$(TEXIN$,3,Len(TEXIN$)-2)
  1062.             End If 
  1063.             Text 1,YPOS,TEXIN$
  1064.             YPOS=YPOS+SIZE_OF_ARTICLE_FONT
  1065.          Until YPOS=>(Screen Height(0)+8)-SIZE_OF_ARTICLE_FONT
  1066.          'Fade 1,0,$FFF,$AF1,$555,$777,$999,$1F1 : Wait 15
  1067.          Fade 1,0,$FFF,$D20,$FF0,$F0,$3AF,$C1A : Wait 15
  1068.          Flash 7,"(FFF,20)(000,20)" : Wait 10
  1069.          _UPDATE_TEXT=False
  1070.       End If 
  1071.       
  1072.       S$=Inkey$ : S=Scancode
  1073.       
  1074.       If Mouse Screen=1 or S<>0
  1075.          Screen 1
  1076.          If Mouse Key=1 or S<>0
  1077.             
  1078.             If Mouse Zone=1 or S=69
  1079.                BACK_TO_SELECT=True
  1080.             End If 
  1081.             
  1082.             If Mouse Zone=3 or S=55
  1083.                _MUSIC_OPTION
  1084.             End If 
  1085.             
  1086.             If Mouse Zone=4
  1087.                If ARTICLE_SCREEN>1
  1088.                   ARTICLE_SCREEN=1 : _UPDATE_TEXT=True
  1089.                End If 
  1090.             End If 
  1091.             
  1092.             If Mouse Zone=5
  1093.                If ARTICLE_SCREEN<AMOUNT_OF_PAGES
  1094.                   ARTICLE_SCREEN=AMOUNT_OF_PAGES : _UPDATE_TEXT=True
  1095.                End If 
  1096.             End If 
  1097.             
  1098.             If Mouse Zone=6 or S=78
  1099.                If ARTICLE_SCREEN<AMOUNT_OF_PAGES
  1100.                   Inc ARTICLE_SCREEN : _UPDATE_TEXT=True
  1101.                End If 
  1102.             End If 
  1103.             
  1104.             If Mouse Zone=7 or S=79
  1105.                If ARTICLE_SCREEN>1
  1106.                   Dec ARTICLE_SCREEN : _UPDATE_TEXT=True
  1107.                End If 
  1108.                
  1109.                If S<>0
  1110.                   S=0
  1111.                   S$=""
  1112.                   Clear Key 
  1113.                End If 
  1114.                
  1115.             End If 
  1116.          End If 
  1117.       End If 
  1118.    Until BACK_TO_SELECT=True
  1119.    _SHOW_SELECTION_SCREEN[SCR]
  1120. End Proc
  1121. Procedure _CHKDSK
  1122. '   If Not Exist("zoo:") 
  1123. '      Edit  
  1124. '   End If 
  1125. End Proc
  1126. Procedure _PLAY_MUSIC
  1127.    If Length(3)>0
  1128.       Led Off 
  1129.       Track Play 3
  1130.       Track Loop On 
  1131.    End If 
  1132. End Proc
  1133. Procedure _MUSIC_OPTION
  1134.    If _MUSIC=True
  1135.       Track Stop 
  1136.       _MUSIC=False
  1137.       Led On 
  1138.    Else 
  1139.       _PLAY_MUSIC
  1140.       _MUSIC=True
  1141.    End If 
  1142.    Wait 40
  1143. End Proc
  1144. Procedure _LOAD_MUSIC
  1145.    _CHKDSK
  1146.    Hide On 
  1147.    Load Iff "pics/ima1.pic",0 : Hide On : Wait Vbl 
  1148.    Fade 3,$FFF,$FFD,$EEB,$CD9,$AC8,$8B7,$5A5,$495,$385,$275,$165,$155,$34,$23,$12,$1
  1149.    Wait 3*15
  1150.    If Length(3)=0
  1151.       Track Load "zoo:mod.START",3
  1152.    End If 
  1153.    Load Iff "pics/ima2.pic",1 : Screen To Back 1
  1154.    _PLAY_MUSIC
  1155.    Screen 0 : Fade 1,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF
  1156.    Wait 15
  1157.    Screen 1 : Palette $FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF,$FFF
  1158.    Screen To Front 1
  1159.    Fade 1,$FFF,$FDB,$DA8,$C76,$A44,$835,$726,$627,$416,$205,$104,$103,$2,$1,$0,$0
  1160.    Wait 15
  1161. End Proc
  1162. Procedure _GO_PIC
  1163.    Colour Back $0 : Wait Vbl 
  1164.    Screen Close 0 : Screen 1 : Fade 1 : Wait 15 : Screen Close 1
  1165. End Proc
  1166. Procedure _FADEUP[SCR]
  1167.    Def Fn MAKECOL(R,G,B)=R*256+G*16+B
  1168.    Def Fn RED(C)=(C/256) mod 16
  1169.    Def Fn GREEN(C)=(C/16) mod 16
  1170.    Def Fn BLUE(C)=C mod 16
  1171.    
  1172.    Screen Hide SCR
  1173.    Dim CR(15)
  1174.    Dim CG(15)
  1175.    Dim CB(15)
  1176.    Dim CFULL(15)
  1177.    For LOP=0 To 15
  1178.       'C(LOP)=Colour(LOP)
  1179.       C=Colour(LOP)
  1180.       R#= Fn RED(Colour(LOP))
  1181.       G#= Fn GREEN(Colour(LOP))
  1182.       B#= Fn BLUE(Colour(LOP))
  1183.       CR(LOP)=R#
  1184.       CG(LOP)=G#
  1185.       CB(LOP)=B#
  1186.    Next 
  1187.    Colour 0,$0
  1188.    Colour 15,$0
  1189.     Extension_18_03CA 0 To 15
  1190.    'Hide  
  1191.    Screen Show 0
  1192.    
  1193.    TWAIT=1
  1194.    LEVEL=15
  1195.    For LOP2=1 To LEVEL
  1196.       For LOP=0 To 15 Step 1
  1197.          R#= Fn RED(Colour(LOP))
  1198.          G#= Fn GREEN(Colour(LOP))
  1199.          B#= Fn BLUE(Colour(LOP))
  1200.          R#=R#+1
  1201.          G#=G#+1
  1202.          B#=B#+1
  1203.          If R#>CR(LOP) Then R#=CR(LOP)
  1204.          If G#>CG(LOP) Then G#=CG(LOP)
  1205.          If B#>CB(LOP) Then B#=CB(LOP)
  1206.          'Colour LOP, Fn MAKECOL(R#,G#,B#)
  1207.          CFULL(LOP)= Fn MAKECOL(R#,G#,B#)
  1208.          For LOP3=1 To TWAIT : Next 
  1209.       Next LOP
  1210.       For LOP=0 To 15 Step 1
  1211.          Colour LOP,CFULL(LOP)
  1212.       Next 
  1213.       '   Wait Vbl 
  1214.    Next 
  1215. End Proc
  1216. Procedure _LOADING
  1217.    Ink 1
  1218.    Bar 150,70 To 500,150
  1219.    _SETFONT["newcentury",24]
  1220.    LODEE$="LOADING"
  1221.    Text(640/2)-(Text Length(LODEE$)/2),110,LODEE$
  1222. End Proc
  1223. Procedure _CLEAR_PALETTE
  1224.    Flash Off 
  1225.    Palette 0,0,0,0,0,0,0,0
  1226. End Proc
  1227. Procedure _RESTORE_PALETTE
  1228.    Palette $0,$FFF,$D20,$FF0,$F0,$3AF,$C1A
  1229.    Flash 7,"(FFF,20)(000,20)"
  1230. End Proc
  1231. Procedure _CONVERT
  1232.    '   Dir$="hd1:coding/amos_pro/z003/" 
  1233.    '   Load "ANIMALS30-35"
  1234.    Colour Back $FFF : Wait Vbl 
  1235.    Screen Open 0,640,256,2,Hires
  1236.    Curs Off 
  1237.    Palette $FFF,$FFF
  1238.    Flash Off 
  1239.    'Wait 10 
  1240.    For A=30 To 34
  1241.       Paper 0 : Cls 
  1242.       Unpack A
  1243.       PBASE=Phybase(0)
  1244.       Reserve As Work A,20480
  1245.       Copy PBASE,PBASE+20480 To Start(A)
  1246.    Next 
  1247.    Erase 35
  1248. End Proc
  1249.  
  1250. '--------- setup routines(routine(stuff)..?.)  
  1251. _CONVERT
  1252. _LOAD_MUSIC
  1253. _FONTS_INTO_RAM[10]
  1254. '_INFO_ON_FONTS[1119]
  1255. '_SETUP_BOBS : Rem  PUT IN IF YA LIKE (NOT NEEDED COZ BOBS ARE IN BANK 1)    
  1256. _GO_PIC
  1257. _SETUP_SCREENS
  1258. _CHECK_EFILES[NUM_OF_PAGES]
  1259. _LOAD_SELECTION_PAGES
  1260. Show On 
  1261.  
  1262. '-------- main loop for selecting
  1263. _SHOW_SELECTION_SCREEN[SELECT_PAGE]
  1264. _SELECT_ONE[1]